#ifndef RGUI_BUTTON_HPP
#define RGUI_BUTTON_HPP

#include "Rectangle.hpp"
#include "Text.hpp"
#include "Color.hpp"

#include "RenderObject.hpp"
#include <string>

namespace rgui
{

class Button : public RenderObject
{
public:
							Button(const rgui::vec2f &position, const rgui::vec2f &size, const rgui::Colorf &color, const std::wstring &text = std::wstring());

	const rgui::Colorf&		getColor();
	virtual void			setColor(const rgui::Colorf &color);
	
	void					onMousePressed(const rgui::vec2i &cursorPosition);
	void					onMouseReleased(const rgui::vec2i &cursorPosition);
	virtual void			onClick(const rgui::vec2i &cursorPosition) = 0;
	virtual void			update(const rgui::vec2i &cursorPosition);
	virtual void			render(const rgui::RenderEffect &renderEffect = rgui::RenderEffect()) = 0;
	virtual void			mouseEnter() = 0;
	virtual void			mouseLeave() = 0;
	virtual void			onPressed() = 0;
	virtual void			onReleased() = 0;
protected:
	rgui::Rectangle mRectangle;
	rgui::Text mText;
	rgui::Colorf mColor;
	bool mMouseInside;
};

}

#endif